Tutorial:   Jupyter Notebook: File Operations



New¶

Back to Table of Contents

  • Install and launch Jupyter as described in the Install tutorial.

  • Select New , then Python 3

screenshot



  • A new notebook will be created in a new browser tab.

screenshot




Open¶

Back to Table of Contents

  • From Jupyter's Home screen, click on the .ipynb file you want to open.

screenshot




Rename¶

Back to Table of Contents

  • By default, the Jupyter notebook is named Untitled

  • To rename the notebook, click on the file name.

screenshot



  • Enter a new file name in the dialog box, then press Rename.

screenshot



  • Return to the Jupyter Home Page (in the first tab), and verify that the file name has been saved.

screenshot




Save¶

Back to Table of Contents

  • By default, Jupyter automatically saves notebook changes.

  • However, it is also useful to manually save the notebook when you reach milestones. For example: question finished, cell finished, assignment finished, etc.

  • To manually save the notebook, select File .. Save and Checkpoint

ascreenshot




Find notebook file on your PC¶

Back to Table of Contents

  • When a notebook is created, it is saved to your computer as an IPYNB file (Interactive Python Notebook)

  • To find out where on your PC a notebook is saved:

    • Ensure that a notebook is open
    • In a Python cell, enter pwd (print working directory) then select Run

screenshot



  • The folder containing the notebook will be displayed. In this case, it is the Downloads folder.

screenshot



  • Open a file explorer window (e.g., Explorer [Windows], Finder [Mac]) and find the folder.

  • Note that there is a file called Assn01.ipynb ; this is the notebook file.

screenshot


Close¶

Back to Table of Contents

  • To close an open notebook, select File .. Close and Halt

ascreenshot



  • The tab will close, returning you to the Jupyter Home tab.

  • Verify that the notebook's icon is gray.

  • Also verify Last Modified time (i.e., the time when the notebook was last saved).

ascreenshot



  • Note that open notebooks' icons are green.

  • Also note that Running is displayed when the notebook is open.

ascreenshot




Export (HTML)¶

Back to Table of Contents

  • Select File .. Download as .. HTML

ascreenshot



  • The exported HTML file will appear in the same folder as the open notebook.

ascreenshot



  • Double-click on the HTML file to open it.

  • Verify that the contents look as expected.

ascreenshot




Quit¶

Back to Table of Contents

  • Close all files as described above

  • From the Jupyter Home screen, select Quit

screenshot

  • Verify that the Server stopped message appears.



screenshot



  • You can now safely close the brower tab and/or quit the browser.